package com.xuhuan.client.business.splitfile.feign;

import com.xuhuan.client.business.splitfile.vo.ZoneMd5ListVO;
import com.xuhuan.client.business.splitfile.vo.ZoneCheckRequestVO;
import com.xuhuan.client.business.splitfile.vo.ZoneUploadVO;
import com.xuhuan.client.result.RequestResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author huan.xu
 * @Date 2023/6/19 13:48
 * @Description
 */
@FeignClient(
        name = "${remote.server.name}",
        contextId = "ISplitFileRemoteClient",
        url = "${remote.server.url}"
)
public interface ISplitFileRemoteClient {

    /**
     * 接收单个分片文件
     *
     * @param zoneUploadVO
     * @return
     */
    @PostMapping("/server/split-file/receive-sign-zone-file")
    RequestResult receiveSignZoneFile(@RequestBody ZoneUploadVO zoneUploadVO);

    /**
     * 检查分片信息，返回协会现有的分片数据，下次就只需要再上传缺失的分片数据
     *
     * @param requestVO
     * @return
     */
    @PostMapping("/server/split-file/check-zone-file")
    RequestResult<ZoneMd5ListVO> checkZoneFile(@RequestBody ZoneCheckRequestVO requestVO);

    /**
     * 合并分片
     *
     * @param zoneMd5ListVO
     * @return
     */
    @PostMapping("/server/split-file/merge-zone-file")
    RequestResult mergeZoneFile(@RequestBody ZoneMd5ListVO zoneMd5ListVO);

}
